import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import '@a/axios'
// 引入公共样式文件
import '@s'
// import VueClipboard from 'vue-clipboard2'
// Vue.use(VueClipboard)
// 引入iview组件
import iView from 'iview'
import 'iview/dist/styles/iview.css'
Vue.use(iView)

Vue.config.productionTip = false

import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

// 配置路由权限
router.beforeEach((to, from, next) => {
	if (to.meta.requireAuth) { // 判断该路由是否需要登录权限
		if (localStorage.getItem('loginStatus')) { // 判断本地是否存在access_token
			next()
		} else {
			// 未登录,跳转到登陆页面，并且带上 将要去的地址，方便登陆后跳转。
			next({
				path: '/',
			})
		}
	} else {
		next()
	}
})

// Vue.use(VueQuillEditor /* { default global options } */)
new Vue({
	router,
	store,
	render: h => h(App),
}).$mount('#app')
